import { ImageModel } from "./Image";
import { KindModel } from "./Kind";
import { StoreModel } from "./Store";
import { UserModel } from "./User";

interface Commodity {
    gid?: number;
    uid: number;
    sid?: number;
    commodityName: string;
    count: number;
    price: number;
    createTime?: Date;
    soldOutTime?: Date;
    description: string;
    kind?: KindModel;
    image?: ImageModel;
    user?: UserModel;
    type: string;
    status?: number;
    point?: number;
    browse?: number;
    isAuth?: number;
    store?: StoreModel;
}


export class CommodityModel implements Commodity {
    gid?: number | undefined;
    uid!: number;
    sid?: number | undefined;
    commodityName!: string;
    count!: number;
    price!: number;
    createTime?: Date | undefined;
    soldOutTime?: Date | undefined;
    description!: string;
    kind?: KindModel | undefined;
    image?: ImageModel | undefined;
    user?: UserModel | undefined;
    type!: string;
    status?: number | undefined;
    point?: number | undefined;
    browse?: number | undefined;
    isAuth?: number | undefined;
    store?: StoreModel | undefined;
}